using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_UIDate_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.UIDate);
            args = new Type[]{};
            method = type.GetMethod("get_YearUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_YearUnit_0);
            args = new Type[]{typeof(System.String)};
            method = type.GetMethod("set_YearUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_YearUnit_1);
            args = new Type[]{};
            method = type.GetMethod("get_MonUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_MonUnit_2);
            args = new Type[]{typeof(System.String)};
            method = type.GetMethod("set_MonUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_MonUnit_3);
            args = new Type[]{};
            method = type.GetMethod("get_DayUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_DayUnit_4);
            args = new Type[]{typeof(System.String)};
            method = type.GetMethod("set_DayUnit", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_DayUnit_5);
            args = new Type[]{typeof(huqiang.Data.FakeStruct), typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.Core.HGUI.UIInitializer)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_6);

            field = type.GetField("StartYear", flag);
            app.RegisterCLRFieldGetter(field, get_StartYear_0);
            app.RegisterCLRFieldSetter(field, set_StartYear_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_StartYear_0, AssignFromStack_StartYear_0);
            field = type.GetField("EndYear", flag);
            app.RegisterCLRFieldGetter(field, get_EndYear_1);
            app.RegisterCLRFieldSetter(field, set_EndYear_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_EndYear_1, AssignFromStack_EndYear_1);
            field = type.GetField("year", flag);
            app.RegisterCLRFieldGetter(field, get_year_2);
            app.RegisterCLRFieldSetter(field, set_year_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_year_2, AssignFromStack_year_2);
            field = type.GetField("month", flag);
            app.RegisterCLRFieldGetter(field, get_month_3);
            app.RegisterCLRFieldSetter(field, set_month_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_month_3, AssignFromStack_month_3);
            field = type.GetField("day", flag);
            app.RegisterCLRFieldGetter(field, get_day_4);
            app.RegisterCLRFieldSetter(field, set_day_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_day_4, AssignFromStack_day_4);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.UIDate());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.UIDate[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_YearUnit_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.YearUnit;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_YearUnit_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.YearUnit = value;

            return __ret;
        }

        static StackObject* get_MonUnit_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.MonUnit;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_MonUnit_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.MonUnit = value;

            return __ret;
        }

        static StackObject* get_DayUnit_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.DayUnit;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_DayUnit_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.DayUnit = value;

            return __ret;
        }

        static StackObject* Initial_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIInitializer @initializer = (huqiang.Core.HGUI.UIInitializer)typeof(huqiang.Core.HGUI.UIInitializer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UIElement @element = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Data.FakeStruct @mod = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.UIDate instance_of_this_method = (huqiang.UIComposite.UIDate)typeof(huqiang.UIComposite.UIDate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@mod, @element, @initializer);

            return __ret;
        }


        static object get_StartYear_0(ref object o)
        {
            return ((huqiang.UIComposite.UIDate)o).StartYear;
        }

        static StackObject* CopyToStack_StartYear_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIDate)o).StartYear;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_StartYear_0(ref object o, object v)
        {
            ((huqiang.UIComposite.UIDate)o).StartYear = (System.Int32)v;
        }

        static StackObject* AssignFromStack_StartYear_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @StartYear = ptr_of_this_method->Value;
            ((huqiang.UIComposite.UIDate)o).StartYear = @StartYear;
            return ptr_of_this_method;
        }

        static object get_EndYear_1(ref object o)
        {
            return ((huqiang.UIComposite.UIDate)o).EndYear;
        }

        static StackObject* CopyToStack_EndYear_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIDate)o).EndYear;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_EndYear_1(ref object o, object v)
        {
            ((huqiang.UIComposite.UIDate)o).EndYear = (System.Int32)v;
        }

        static StackObject* AssignFromStack_EndYear_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @EndYear = ptr_of_this_method->Value;
            ((huqiang.UIComposite.UIDate)o).EndYear = @EndYear;
            return ptr_of_this_method;
        }

        static object get_year_2(ref object o)
        {
            return ((huqiang.UIComposite.UIDate)o).year;
        }

        static StackObject* CopyToStack_year_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIDate)o).year;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_year_2(ref object o, object v)
        {
            ((huqiang.UIComposite.UIDate)o).year = (System.Int32)v;
        }

        static StackObject* AssignFromStack_year_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @year = ptr_of_this_method->Value;
            ((huqiang.UIComposite.UIDate)o).year = @year;
            return ptr_of_this_method;
        }

        static object get_month_3(ref object o)
        {
            return ((huqiang.UIComposite.UIDate)o).month;
        }

        static StackObject* CopyToStack_month_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIDate)o).month;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_month_3(ref object o, object v)
        {
            ((huqiang.UIComposite.UIDate)o).month = (System.Int32)v;
        }

        static StackObject* AssignFromStack_month_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @month = ptr_of_this_method->Value;
            ((huqiang.UIComposite.UIDate)o).month = @month;
            return ptr_of_this_method;
        }

        static object get_day_4(ref object o)
        {
            return ((huqiang.UIComposite.UIDate)o).day;
        }

        static StackObject* CopyToStack_day_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIDate)o).day;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_day_4(ref object o, object v)
        {
            ((huqiang.UIComposite.UIDate)o).day = (System.Int32)v;
        }

        static StackObject* AssignFromStack_day_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @day = ptr_of_this_method->Value;
            ((huqiang.UIComposite.UIDate)o).day = @day;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.UIDate();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
